package com.castday2.castday2.test;

import com.castday2.castday2.bean.User;
import com.castday2.castday2.mapper.UserMapper;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

/**
 * @Author : 徐闯 mpcast
 * @Date : 2021-05-24 20:05:01
 * @Description :
 **/
@RunWith(SpringRunner.class)
@SpringBootTest
public class D_IdTypeDemo {
    @Autowired
    private UserMapper userMapper;
    // 插入  主键策略
    @Test
    public void test1(){
        User user = new User();
        user.setId(-1);
        user.setAge(20);
        user.setEmail("xxxx");
        user.setName("快乐");
        int n = userMapper.insert(user);
        System.out.println("受影响的数据的条数 ===》 "+n);
    }
}
